import { get, post } from './request';

// 图形验证码
export const authCodeAPI = (): Promise<AnyObject> => get('/auth/authCode');
// 验证码登录
export const loginByCodeAPI = (data: AnyObject) => post('/administrator/checkloginByCode', data);


// 缴费列表
export const feeListAPI = (params: AnyObject) => get('/fee/list', params);

// 居民列表
export const userListAPI = (params: AnyObject) => get('/userinfo/list', params);
// 删除居民
export const userDeleteAPI = (id: number) => get('/userinfo/delete', { id });
export const userDeleteAllAPI = (ids: number[]) => post('/userinfo/deleteall', { ids });
// 添加/编辑居民
export const userAddAPI = (data: AnyObject) => post('/userinfo/add', data);
// 居民类型
export const userTypeListAPI = () => get('/userinfotype/list');

// 楼栋列表
export const buildingListAPI = () => get('/building/list');
// 房间列表
export const houseListAPI = (buildingid: number) => get('/houses/list', { buildingid });

// 获取角色列表
export const roleListAPI = (params: AnyObject) => get('/administratorrole/list', params);
// 添加角色
export const roleAddAPI = (data: AnyObject) => post('/administratorrole/add', data);
// 获取权限功能列表
export const menuListAPI = (roleid = 0) => get('/menu/list', { roleid });

// 门店列表
export const storesListAPI = (params: AnyObject) => get('/stores/list', params);
// 添加门店
export const storesAddAPI = (data: AnyObject) => post('/stores/add', data);
// 门店详情
export const storesDetailAPI = (id: number) => get('/stores/get', { id });
// 服务范围
export const storeServicesListAPI = () => get('/storeservices/list');

// 图表
export const getRepairsCountsListAPI = (params: AnyObject) => get('/repairs/getCountsList', params);
export const getQuestionsCountsListAPI = (params: AnyObject) => get('/questions/getCountsList', params);
